<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>Promise</h1>


    <script>
      Promise.resolve(2).then((a) => {console.log('我是a',a);}, () => {})

    // resolve 的值是 2
    Promise.resolve(2).finally((b) => {console.log("我是b",b);})
        // resolve 的值是 2
        Promise.resolve(2).then((c) => {console.log('我是c',c);}, () => {})
        .finally((c) => {console.log("我是c",c);})

        const promises = [2, 3, 5, 7, 11, 13].map(function (id) {
          // let posts = '/post/' + id + ".json";
          console.log("posts",'/post/' + id + ".json");
          return '/post/' + id + ".json";
        });
        console.log("promises",promises);
    </script>
</body>
</html>